<template>
  <div class="check-info">
    <el-drawer
        class="diy-draw"
        title="检查详情"
        :wrapperClosable="false"
        :visible.sync="infoOpen">
      <drawer-content>
        <template slot="body">
          <el-scrollbar>
            <info-table :table-config="infoConfig" :data="infoData"></info-table>
          </el-scrollbar>
        </template>
      </drawer-content>
    </el-drawer>
  </div>
</template>

<script>
import infoTable from "@/views/components/InfoTable/index.vue";
import {getInspectDetail} from "@/api/checkPage/checkApi";

export default {
  components:{
    infoTable
  },
  data(){
    return {
      infoOpen: false,
      infoConfig: [
        {
          label: '检查名称',
          value: 'inspectName',
          icon:'',
        },
        {
          label: '检查年份',
          value: 'inspectYear',
          icon:'',
        },
        {
          label: '检查层级',
          value: 'inspectLevelName',
          icon:'',
        },
        {
          label: '牵头部门',
          value: 'inspectLeaderDept',
          icon:'',
        },
        {
          label: '检查内容',
          value: 'inspectContent',
          icon:'',
        },
        {
          label: '计划完成时间',
          value: 'planCompleteTime',
          icon:'',
        },
        {
          label: '检查组联络员',
          value: 'inspectLiaison',
          icon:'',
        },
        {
          label: '检查组联络方式',
          value: 'inspectLiaisonContact',
          icon:'',
        },
        {
          label: '检查组成员',
          value: 'memberName',
          icon:'',
          type: 'tag',
          tagConfig: {
            prop: {
              label: '',
              value: ''
            },
            escapeConfig: []
          }
        },
        {
          label: '目标监管单位',
          value: 'superviseOrg',
          icon:'',
          type: 'tag',
          tagConfig: {
            prop: {
              label: 'orgName',
              value: 'orgType'
            },
            escapeConfig: [
              {
                type: '',
                value: '1'
              },
              {
                type: 'success',
                value: '2'
              },
            ]
          }
        },
        {
          label: '目标企业类型',
          value: 'enterpriseTypeName',
          icon:'',
          type: 'tag',
          tagConfig: {
            prop: {
              label: '',
              value: ''
            },
            escapeConfig: []
          }
        },
        {
          label: '依据文件',
          value: 'fileVos',
          icon:'',
          type: 'file'
        },
      ],
      infoData: {}
    }
  },
  methods: {
    showCheckInfo(id) {
      let owner = this
      this.startLoading('正在加载....')
      getInspectDetail({id}).then(res => {
        owner.infoData = res.data
        owner.infoOpen = true
      }).finally(() => {
        owner.endLoading()
      })
    }
  }
}
</script>

<style scoped>

</style>
